#!/bin/bash
echo $1
a="home"
b="company"
s="/root/ifcfg-enp0s3"
t=/etc/sysconfig/network-scripts/ifcfg-enp0s3
if [[ $1 = $a || $1 = $b ]]
then
 echo 1
 echo $s"-"$1
 /bin/cp $s"-"$1 $t
 if [ $? == 0 ]
  then
   systemctl restart network
   echo $?
   echo `ifconfig enp0s3|grep 'inet '|awk '{print $2}'`
   systemctl restart docker
   echo $?
 fi
else
 echo 2
 echo '错误输入'
fi

